package com.hubu.admin.controller;

import com.hubu.admin.entity.User;
import com.hubu.admin.service.IUserService;
import com.hubu.admin.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wx:zjj33126135
 * @since 2023-12-12
 */
@RestController
@Api("登录登出")
public class IndexController {

    @Resource
    private IUserService userService;

    @ApiOperation("用户登录")
    @PostMapping("login")
    public Result login(@RequestBody User user){
        return Result.success(userService.login(user.getUsername(), user.getPassword()));
    }


}
